import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/global.css'
import axios from "axios";
import VueRouter from "vue-router";
import router from './router';
import store from './store';

//设置axios拦截器，请求时携带token
axios.interceptors.request.use(config => {
        config.headers["Content-Type"] = 'application/json;charset=utf-8'
        if (sessionStorage.getItem("token") != null) {
            config.headers["Authorization"] = sessionStorage.getItem("token");
        }
        return config;
    },
    error => {
        Promise.reject(error);
    })
Vue.prototype.$axios = axios;
Vue.prototype.$httpUrl = 'http://localhost:8090'
Vue.config.productionTip = false


// Vue.use(ElementUI);
Vue.use(VueRouter);
Vue.use(ElementUI, {size: 'small'});
new Vue({
    router,
    store,
    render: h => h(App),
}).$mount('#app')
